<?php
/**
 * 精美图文模块处理程序
 * @author 史中营
 * @url http://www.mamani.cn
 */
defined('IN_IA') or exit('Access Denied');

class Amouse_articleModule extends WeModule {

    public function fieldsFormDisplay($rid = 0) {
        //要嵌入规则编辑页的自定义内容，这里 $rid 为对应的规则编号，新增时为 0
    }

    public function fieldsFormValidate($rid = 0) {
        //规则编辑保存时，要进行的数据验证，返回空串表示验证无误，返回其他字符串将呈现为错误提示。这里 $rid 为对应的规则编号，新增时为 0
        return '';
    }

    public function fieldsFormSubmit($rid) {
        //规则验证无误保存入库时执行，这里应该进行自定义字段的保存。这里 $rid 为对应的规则编号
    }

    public function ruleDeleted($rid) {
        //删除规则时调用，这里 $rid 为对应的规则编号
    }


    public function settingsDisplay($settings) {
        global $_GPC, $_W;
        load()->func('tpl');
        if(checksubmit()) {
            $cfg = array();
            $cfg['guanzhuUrl'] = htmlspecialchars_decode($_GPC['guanzhuUrl']);
            $cfg['guanzhutitle'] = $_GPC['guanzhutitle'];
            $cfg['copyright'] = $_GPC['copyright'];
            $cfg['patron'] = $_GPC['patron'];
            $cfg['contact'] = $_GPC['contact'];
            $cfg['gameUrl'] = $_GPC['gameUrl'];
            $cfg['countUrl'] = $_GPC['countUrl'];
            $cfg['bjthumb'] = $_GPC['bjthumb'];
            if($this->saveSettings($cfg)) {
                message('保存成功', 'refresh');
            }
        }
        include $this->template('setting');
    }


}
